//
//  FWViewController.m
//  ShareTest
//
//  Created by 范文青 on 14-6-18.
//  Copyright (c) 2014年 fwq. All rights reserved.
//

#import "FWViewController.h"
#import "FWShareObject.h"
#import "FWShareValues.h"
#import "FWAuthUser.h"
@interface FWViewController ()

@end

@implementation FWViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self.view setBackgroundColor:[UIColor purpleColor]];
    [self performSelector:@selector(AAAA) withObject:nil afterDelay:1.0f];
    
    FWAuthUser  *usr = [FWAuthUser userByMediaType:QQ_HULIAN];
    if (usr != nil) {
        NSLog(@"authed");
        NSLog(@"%@",[usr dictionaryRepresentation]);
    }else{
        NSLog(@"no auth yet");
    }
}

- (void)AAAA
{
    FWShareObject  *obj = [[FWShareObject alloc] initWithPlatform:SINA_WEIBO];
    [obj setForceAuth:YES];
    [obj auth:self success:^(FWAuthUser *user, NSString *p) {
        NSLog(@"%@",[user dictionaryRepresentation]);
    } failed:^(NSError *error, NSString *p) {
        
    } canceled:^(NSString *error) {
        
    }];
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
